Trò chơi Angry Birds trong UNITY Engine
31.675 lượt xem;
1 using UnityEngine;
2 using System.Collections;
3 using System.Collections.Generic;
4
5
6 /// <summary>
7 /// place this script on any GameObject to enable route editing. note that it is not required at runtime! it is
8 /// only required to be in your scene while editing a path
9 /// </summary>
10 public class GoDummyPath : MonoBehaviour
11 {
12 public string pathName = string.Empty;
13 public Color pathColor = Color.magenta; // color of the path if visible in the editor
14 public List<Vector3> nodes = new List<Vector3>() { Vector3.zero, Vector3.zero };
15 public bool useStandardHandles = false;
16 public bool forceStraightLinePath = false;
17 public int pathResolution = 50;
18
19
20 public void OnDrawGizmos()
21 {
22 // the editor will draw paths when force straight line is on
23 if( !forceStraightLinePath )
24 {
25 var spline = new GoSpline( nodes );
26 Gizmos.color = pathColor;
27 spline.drawGizmos( pathResolution );
28 }
29 }
30
31 }
2 using System.Collections;
3 using System.Collections.Generic;
4
5
6 /// <summary>
7 /// place this script on any GameObject to enable route editing. note that it is not required at runtime! it is
8 /// only required to be in your scene while editing a path
9 /// </summary>
10 public class GoDummyPath : MonoBehaviour
11 {
12 public string pathName = string.Empty;
13 public Color pathColor = Color.magenta; // color of the path if visible in the editor
14 public List<Vector3> nodes = new List<Vector3>() { Vector3.zero, Vector3.zero };
15 public bool useStandardHandles = false;
16 public bool forceStraightLinePath = false;
17 public int pathResolution = 50;
18
19
20 public void OnDrawGizmos()
21 {
22 // the editor will draw paths when force straight line is on
23 if( !forceStraightLinePath )
24 {
25 var spline = new GoSpline( nodes );
26 Gizmos.color = pathColor;
27 spline.drawGizmos( pathResolution );
28 }
29 }
30
31 }